<include file="Public/head" />
<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.parse.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/ueditor/_examples/editor_api.js"></script>
</head>
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar"  menu="nrgl.gggl" />

    <div class="mianR">
        <h3 class="yonghu">修改公告</h3>
        <form id="annForm">
            <div class="gonggao">
                <ul>
                    <li class="clearfix"><span>标题：</span><input type="text" name="ann_title" value="{$announce.title}" id="ann_title"/></li>
                    <li class="clearfix"><span>公告内容:</span><span style="width:400px; text-align: left">注意事项:仅支持左对齐；支持空行、换行。</span></li>
                    <li class="clearfix">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <textarea width="20px" height="30px" name="content" id="content" >{$announce.content}</textarea>
                    </li>
                </ul>
            </div>

            <div class="yongBtn">
                <input type="hidden" value="{$announce.ann_id}" id="ann_id" name="announce.ann_id">
                <input type="button" value="确定" class="queding" />
                <input name="reset" type="reset" class="quxiao" value="取消" />
            </div>
            <div class="clear"></div>
        </form>
    </div>
    <script type="text/javascript">
        $('.quxiao').click(function(){
            window.location.href = "/Announce/index";
        })
        $('.queding').click(function () {
            //var post_data = $("#annForm").serialize();
            //var content = UE.getEditor('myEditor').getContent();
            var ann_id = $('#ann_id').val();
            var ann_title = $("#ann_title").val();
            var content = $("#content").val();
            $.post('/Announce/edit_announce_post',{'ann_id':ann_id,'ann_title':ann_title,'content':content}, function (data) {
                if (data.code != 200) {
                    shibai_alert(data.msg, 800);
                    return false;
                }
                btn_alert(data.msg, 1000, function () {
                    window.location.href = "/Announce/index";
                });
            }, 'json');
        });;
    </script>
    </body>
    </html>
